<?php
namespace App\Services;

use Illuminate\Support\Facades\Cache;

class EmailService{

    protected $mailService;

    public function __call($name, $arguments)
    {
        // TODO: Implement __call() method.
        //方法关注方法能否被访问到，而不仅仅是关注是否存在
    }

    public static function __callStatic($name, $arguments)
    {
        // TODO: Implement __callStatic() method.
        //方法关注的是方法能否被静态的访问到，而不是关注方法是否存在，是否是静态方法
    }

    //具体执行__call,__callStatic，是根据调用的上下文。如果处于静态上下文内，则调用__callStatic。如果处于对象的上线文内，则调用__call

    public function __construct(MailService $mailService)
    {
        $this->mailService = $mailService;
    }

    public function send($send_user){

        info($this->mailService->send($send_user->email));
    }
}
